home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / AppsToGo / AppsToGo.src / =AppWannabe.one.doc.app < prev    next >
Encoding:
Text File  |  1993-06-18  |  4.2 KB  |  69 lines  |  [TEXT/MPS ]

  1. This document assumes that you have read or are familiar with the contents of the
  2. document “AppWannabe.Tutorial”.  This document addresses the needs of an application
  3. that has only a single document type.
  4.  
  5. A single document type is the most straightforward usage of AppWannabe.  AppWannabe
  6. has all of the DTS framework callback functions already implemented.  Many of the
  7. functions are simply stub functions and have no code body.  All you need to do is to
  8. add code to these functions.
  9.  
  10. The functions in AppWannabe that are called by the application framework are commented
  11. as such.  All you need to do to find all of these functions is to do a find on •• for 
  12. the source code files in AppWannabe.
  13.  
  14. You can also look at the file DTS.protos.h to see which functions are expected by the
  15. application framework.  Again, the functions that the framework calls are marked by ••.
  16.  
  17. All you need to do to work harmoniously with the framework is to place the appropriate
  18. code for your application within these functions.  Of course, you can do whatever else
  19. you would like to the AppWannabe application shell, as it is simply the beginning of your
  20. application.  Just remember to verify that you are doing enough for the framework to
  21. get your application task done.  Remember that the completely empty AppWannabe is already
  22. compatible with the framework.  It has all of the necessary functions.  It is simply that
  23. many of these functions don't do anything (since AppWannabe doesn't do anything).
  24.  
  25.  
  26. One immediate choice you will have to make is what to do with the window content.  The
  27. framework separates the window content into two pieces, namely the frame content and
  28. the non-frame content.  The frame content consists of the document scrollbars (if any),
  29. the grow icon (if you have one), top and left sidebars (if any), and an extra irregular
  30. frame area (if you have one).  Everything else is considered non-frame (regular) content.
  31.  
  32. One notable difference is that the frame portion of the window doesn't get imaged when
  33. you print.  This is quite reasonable, as document scrollbars and a grow icon would be
  34. a silly thing to print.  The non-frame portion of the window is the part that prints,
  35. so any portion of the window you want to print will have to be placed in the non-frame
  36. part of the content.
  37.  
  38. The function that prints the non-frame content is ImageDocument.  The port for drawing
  39. is already set when this function is called.  The port will either be the window port or
  40. the printer port.  The global variable gPrintPage is used to determine which case.
  41.  
  42. The function DrawFrame is called to draw the application-portion of the frame.  The
  43. framework draws the document scrollbars and grow icon, if you have such.  Any additional
  44. parts you have in the frame are your responsibility to draw.
  45.  
  46. If you have additional parts you think belong in the frame content, please understand
  47. the various alternatives available to you.  These are:
  48.  
  49. 1) Sidebars.  How to do a crude ruler is demonstrated in “AppWannabe.Tutorial”.
  50. 2) The application frame region.  CalcFrameRgn is responsible for returning the region
  51.    that encompasses the frame area that isn't already included in the document scrollbar,
  52.    grow icon, and sidebar areas.  If you can get your job done in the sidebar areas,
  53.    you don't need this facility.  This facility is for those cases where the “frame”
  54.    area is irregular.
  55. 3) None of the above.  If you have a very simple window content, then it is possible that
  56.    you don't need either of the above facilities.  If your content doesn't scroll, then it
  57.    can most likely all be handled in the content.  Remember, even if you print differently
  58.    than you draw, you can always image conditionally, depending on gPrintPage.
  59.    The big advantage of the frame region is that you don't have to worry about clipping
  60.    these immobile areas of the window content. The framework clips them out for you,
  61.    without using the clip region.  (This leaves the clip region all for you.)
  62.    The content is scrolled without affecting the frame area.  This is why it is good to
  63.    use for things like rulers and such.  Of course if you document doesn't scroll, then
  64.    you don't have to worry about clipping these areas.
  65.  
  66.  
  67. For further information, please refer to the document “AppWannabe.Tutorial”.
  68.  
  69.